package com.example.everying.service.content.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.everying.mapper.content.ActivityAuditMapper;
import com.example.everying.model.entity.content.ActivityAudit;
import com.example.everying.model.vo.content.ActivityAuditVo;
import com.example.everying.service.content.ActivityAuditService;
import org.springframework.stereotype.Service;

/**
 * @program: everything
 * @description: 审批记录
 * @author: zw
 * @create: 2025-05-17 10:40
 **/
@Service
public class ActivityAuditServiceImpl  extends ServiceImpl<ActivityAuditMapper, ActivityAudit> implements ActivityAuditService {
    @Override
    public IPage<ActivityAudit> selectPage(Page<ActivityAudit> pageParam, ActivityAuditVo auditVo) {
        //创建查询wrapper
        ActivityAudit audit = new ActivityAudit();
        BeanUtil.copyProperties(auditVo, audit);
        QueryWrapper<ActivityAudit> wrapper = new QueryWrapper<>(audit);
        wrapper.orderByDesc("creat_time");
        //调用mapper的方法
        return baseMapper.selectPage(pageParam, wrapper);
    }
}
